#include "app_buffer.h"
#include "log/log.h"


int main(int argc, char const *argv[])
{
    // 初始化缓冲区
    Buffer *buffer = app_buffer_init(16);
    // 写入数据
    app_buffer_write(buffer, "abcde", 5);
    app_buffer_write(buffer, "fghijk", 6);
    // 读取数据1
    char data_buf[10];
    int len = app_buffer_read(buffer, data_buf, 10);
    log_debug("data1: %.*s,len: %d",len, data_buf,len);
    //读取数据2
    char data_buf2[10];
    int len2 = app_buffer_read(buffer, data_buf2, 10);
    log_debug("data2: %.*s,len: %d", len2,data_buf2,len2);
    return 0;
}
